/*
  Author: Ionel Crisu - crisuionel@yahoo.com
  support@FlashExtended.com
*/
package com.flashextended.utils.graphics.buttons
{
	import flash.display.Bitmap;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;

	public class VistaSmallButton extends VistaButton
	{
		private var _enabledButton:Boolean = true;
		
		public function VistaSmallButton(bmp:Bitmap, tooltip:String="")
		{
			super(bmp, tooltip);
		}
		
		
		public function set enabledButton(val:Boolean):void
		{
			_enabledButton = val;
			if(_enabledButton)
			{
				this.enabled = true;
				this.buttonMode = true;
				this.alpha = 1;
			}else
			{
				this.enabled = false;
				this.buttonMode = false;
				this.alpha = .3;		
			}
		}
		public function get enabledButton():Boolean
		{
			return _enabledButton;
		}		
		override protected function buttonMouseOver(e:MouseEvent):void
		{
			if(!_enabledButton)
			{
				return;
			}
			applayShadow();
		}
		override protected function buttonMouseOut(e:MouseEvent):void
		{
			if(!_enabledButton)
			{
				return;
			}			
			applayShadow(false);
		}		
				
		override protected function applayShadow(val:Boolean=true):void
		{
			if(val)
			{
				var glow:GlowFilter = new GlowFilter(0xcfcfc6);
				this.filters = [glow];
			}else
			{
				this.filters = null;
			}
		}		
		
	}
}